package com.graduation.rescuematerial.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.graduation.rescuematerial.mapper.UserCompanyMapper;
import com.graduation.rescuematerial.pojo.UserCompany;
import com.graduation.rescuematerial.service.IUserCompanyService;
import com.graduation.rescuematerial.vo.RegisterUserCompanyVo;
import com.graduation.rescuematerial.vo.RespBean;
import com.graduation.rescuematerial.vo.RespBeanEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author CaiShuangLian
 * @since 2022-04-25
 */
@Service
public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserCompany> implements IUserCompanyService {

    @Autowired
    private UserCompanyMapper userCompanyMapper;
    @Override
    public RespBean addOne(RegisterUserCompanyVo registerUserCompanyVo) {
        int row=userCompanyMapper.addOne(registerUserCompanyVo);
        if(row<=0){
            return RespBean.error(RespBeanEnum.UPDATE_ERROR,"更新失败！");
        }
        return RespBean.success();
    }
}
